#ifndef PAGEEMBROADCAST_H
#define PAGEEMBROADCAST_H

#include <QWidget>
#include <QTableWidget>
#include <QTableWidgetItem>
#include <QTimer>
#include "globalconfig.h"

namespace Ui {
class PageEmBroadCast;
}

class PageEmBroadCast : public QWidget
{
    Q_OBJECT

public:
    explicit PageEmBroadCast(QWidget *parent = nullptr);
    ~PageEmBroadCast();
    void syncBroadcastId(uint syncid);
    uint16_t getEmBroadCastID() const {return indexcast;}
signals:
    void signal_EmBroadCastOnceValid(bool);
    void signal_EmBroadCastLoopValid(bool);
private slots:
    void on_ButtonNextPage_clicked();
    void on_ButtonLastPage_clicked();
    void slotItemClicked(QTableWidgetItem *);
    void slotTrigTimer();
    void on_ButtonSingle_clicked();
    void on_ButtonLoop_clicked(bool checked);

private:
    Ui::PageEmBroadCast *ui;
private:
    void initWidget();
    void updateTableWidget();
    void setIndexCast(int index);
private:
    uint16_t indexcast;
};

#endif // PAGEEMBROADCAST_H
